import java.util.ArrayList;

public class day_01_stream_1 {

    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("胡馨予");
        list.add("龚汉强");
        list.add("王林林");
        list.add("王心");

        // stream 流实现过滤
        list.stream().filter(name -> name.startsWith("王")).forEach(System.out::println);
        System.out.println("-----------------------------------------");
        list.stream().filter(name -> name.startsWith("王")).filter(name -> name.length() == 2)
                .forEach(System.out::println);
        
    }
}